Arexx (23/45)

From:Dennis Griffin
Date:5 Sep 2001 at 18:59:17
Subject:Re: Harddrive access

Hello Bernd

On or about 05-Sep-01, Bernd Gollesch wrote:

>> /* filesplitter */
>> open('infile','ram:in','R')
>> open('odd','ram:odd','W')
>> open('even','ram:even','W')
>> do until eof('infile')
>> writeln('odd',readln('infile'))
>> writeln('even',readln('infile'))
>> end

> You should place a CALL in front of each function:

> /* filesplitter */
> call open('infile','ram:in','R')
> call open('odd','ram:odd','W')
> call open('even','ram:even','W')
> do until eof('infile')
> call writeln('odd',readln('infile'))
> call writeln('even',readln('infile'))
> end

> open() and writeln() are returning a value and without the call
> statement before, Arexx tries to interpret the returned value
> as a command. If you run snoopdos you will notice that Arexx
> tries to open some files (eg 1, 1.rexx, REXX:1, REXX:1.rexx or so).

Yes! I tried both programs using an "in" file of 286K (5778 lines) and my
original program took 183.2 seconds to complete. With the call statements
the same file processed in 2.3 seconds. I'd call that a significant
improvement!

Thanks!



*Dennis Griffin*
Geographic Information Specialist & Forest Webmaster
USDA-Forest Service - Fremont National Forest - Lakeview Ranger District
HC 64 Box 60, Lakeview, Oregon, 97630, USA
dbgriffin@fs.fed.us http://www.fs.fed.us/r6/fremont

------------------------ Yahoo! Groups Sponsor ---------------------~-->
Secure your servers with 128-bit SSL encryption! Grab your copy of VeriSign's FREE Guide: "Securing Your Web Site for Business." Get it Now!
http://us.click.yahoo.com/n7RbFC/zhwCAA/yigFAA/saFolB/TM
---------------------------------------------------------------------~->

ARexx mailing list - No flames, no overquoting, no crossposting.
Unsub: Blank mail to mailto:arexx-unsubscribe@yahoogroups.com

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/